#include<stdio.h>
#include<unistd.h>
#include<sys/wait.h>
int main()
{
	printf("创建子进程之前\n");	
	pid_t id = fork();
	if(id < 0)
	{
		return 1;
	}
	else if(id == 0)
	{
		//chind
		printf("child pid:%d\n",getpid());
	
	}
	else 
	{
		printf("parent pid:%d\n\n",getpid());
		wait(NULL);	
	}
	printf("创建子进程之后\n");
	return 0;
}
